CAIRO (AP) — The ceasefire between Hamas and Israel will go into effect Sunday at 8:30 a.m. local time (0630 GMT), mediator Qatar announced Saturday, as families of hostages held in Gaza braced for news of loved ones, Palestinians prepared to receive freed detainees and humanitarian groups rushed to set up a surge of aid.

But in a national address 12 hours before the ceasefire was to start, Israeli Prime Minister Benjamin Netanyahu said the country was treating the ceasefire as temporary and retained the right to continue fighting if necessary. He claimed he had the support of U.S. President-elect Donald Trump, who told NBC News that he told the prime minister to “keep doing what you have to do.”

Netanyahu also asserted that he negotiated the best deal possible, even as Israel’s far-right Public Security Minister Itamar Ben-Gvir said he and most of his party would resign from the government in opposition to it.

The prime minister earlier warned that a ceasefire wouldn’t go forward unless Israel received the names of hostages to be released, as agreed. Israel had expected to receive the names from mediator Qatar. There was no immediate response from Qatar or Hamas.

The overnight approval of the ceasefire deal by Israel's Cabinet, in a rare meeting during the Jewish Sabbath, set off a flurry of activity and a fresh wave of emotions as relatives wondered whether hostages would be returned alive or dead. Families and thousands of others rallied once more Saturday night in Tel Aviv.

“Please keep going and saving lives,” said Anat Angrest, whose son Matan Angrest is still held in Gaza.

The pause in 15 months of war is a step toward ending the deadliest, most destructive fighting ever between Israel and the Hamas militant group. The deal was achieved under joint pressure from Trump and the outgoing administration of President Joe Biden ahead of Monday's inauguration.

The first phase of the ceasefire will last 42 days, and negotiations on the far more difficult second phase are meant to begin just over two weeks in. After those six weeks, Israel’s security Cabinet will decide how to proceed.

Israeli airstrikes continued Saturday, and Gaza's Health Ministry said 23 bodies had been brought to hospitals over the past 24 hours.

“What is this truce that kills us hours before it begins?” asked Abdallah Al-Aqad, the brother of a woman killed by an airstrike in the southern city of Khan Younis.

And sirens sounded across central and southern Israel, with the military saying it intercepted projectiles launched from Yemen. Iran-backed Houthi rebels there have stepped up attacks in recent weeks, calling it solidarity with Palestinians in Gaza.

When the fighting stops

In the ceasefire's first phase, Israeli troops are to pull back into a buffer zone about a kilometer (0.6 miles) wide inside Gaza along its borders with Israel. With most of Gaza's population in massive, squalid tent camps, Palestinians are desperate to get back to their homes, even though many were destroyed or heavily damaged.

In a post on X, Qatar's foreign minister advised Palestinians and others to exercise caution when the ceasefire goes into effect and wait for directions from officials.

Israel's military later said Palestinians will not be able to cross the Netzarim corridor that runs across central Gaza for the first seven days of the ceasefire, and it warned Palestinians not to approach Israeli forces.

Still, anticipation was high.

“The first thing I will do is go and check my house,” said Mohamed Mahdi, a father of two who was displaced from Gaza City's Zaytoun neighborhood. He also looked forward to seeing family in southern Gaza, but is “still concerned that one of us could be martyred before we are able to meet.”

Majida Abu Jarad said she has moved seven times with her husband and their six daughters during the war, heeding Israeli evacuation orders and staying in tents, abandoned classrooms or on the street.

“We will remain in a tent, but the difference is that the bleeding will stop, the fear will stop, and we will sleep reassured,” she said while packing.

Freed hostages and prisoners

In the ceasefire's first phase, 33 hostages in Gaza are set to be released over six weeks in exchange for 737 Palestinian prisoners held by Israel. Israel’s justice ministry has published a list of the prisoners, all younger or female. An organization that represents victims of Palestinian attacks vowed to petition Israel’s Supreme Court to stop the release.

According to the ceasefire plan approved by Israel’s Cabinet, the exchange will begin at 4 p.m. (1400 GMT) Sunday. The plan says three living female hostages will be returned on Day 1, four on Day 7 and the remaining 26 over the following five weeks.

Among those expected to be released is the youngest hostage, Kfir Bibas, whose family marked his second birthday Saturday. The child has become a symbol across Israel for the helplessness over the hostages’ plight.

During each exchange, Palestinian prisoners will be released by Israel after hostages have arrived safely.

Also to be released are 1,167 Gaza residents who were not involved in the Oct. 7, 2023, Hamas-led attack that sparked the war. All women and children under 19 from Gaza held by Israel will be freed during this phase.

All Palestinian prisoners who were convicted of deadly attacks will be exiled to Gaza or abroad — some for three years and others permanently — and barred from returning to Israel or the West Bank.

The remaining hostages in Gaza, including male soldiers, are to be released in a second phase to be negotiated during the first. Hamas has said it will not release the remaining captives without a lasting ceasefire and a full Israeli withdrawal.

Hundreds of aid trucks a day

Gaza should also see a surge in food, medical supplies and other humanitarian aid.

Egypt's foreign minister said the Rafah crossing, Gaza’s main gateway to the outside world, will start operating soon. The crossing has been closed since Israel's military took over the area last May. The minister said 600 trucks of aid, including 50 fuel trucks, should be entering Gaza daily during the ceasefire.

The ceasefire plan approved by Israel’s Cabinet says all trucks entering Gaza will be subject to Israeli inspections.

“It is clear that the situation in Gaza is still extremely complex and a lot of difficulties still remain for an effective distribution,” U.N. Secretary-General Antonio Guterres said Saturday.

The Hamas-led attack in 2023 killed some 1,200 people and left some 250 captive. Nearly 100 hostages remain in Gaza.

Israel responded with an offensive that has killed more than 46,000 Palestinians, according to local health officials, who do not distinguish between civilians and militants but say women and children make up more than half the dead.

___

Lidman reported from Nahariya, Israel, and Mednick from Jerusalem. Associated Press writer Joe Federman in Jerusalem contributed.

___

Follow AP's war coverage at https://apnews.com/hub/israel-hamas-war

Balloons are released as demonstrators hold portraits of hostages held by Hamas in the Gaza Strip during a protest calling for their immediate release in Tel Aviv, Israel, Saturday Jan. 18, 2025. (AP Photo/Ohad Zwigenberg)

Credit: AP

icon to expand image

Credit: AP

Demonstrators hold torches as they gather during a protest calling for the release of all hostages held captive by Hamas in the Gaza Strip, in Tel Aviv, Israel on Saturday, Jan. 18, 2025. (AP Photo/Oded Balilty)

Credit: AP

icon to expand image

Credit: AP

Demonstrators hold portraits of hostages held by Hamas in the Gaza Strip as a video featuring Kfir Bibas, who, along with his parents Shiri and Yarden Bibas, and his brother Ariel, is still being held hostage in Gaza, plays behind them during a protest in Tel Aviv, Israel, Saturday Jan. 18, 2025. (AP Photo/Ohad Zwigenberg, File)

Credit: AP

icon to expand image

Credit: AP

Demonstrators calling for the release of all hostages gather during a protest in Tel Aviv, Israel, as Israel's security cabinet convened to decide whether to approve a deal that would release dozens of hostages held by militants in Gaza and pause the 15-month-war Saturday, Jan. 18, 2025. (AP Photo/Oded Balilty)

Credit: AP

icon to expand image

Credit: AP

Demonstrators calling for the release of all hostages gather during a protest in Tel Aviv, Israel, as Israel's security cabinet convened to decide whether to approve a deal that would release dozens of hostages held by militants in Gaza and pause the 15-month-war Saturday, Jan. 18, 2025. (AP Photo/Oded Balilty)

Credit: AP

icon to expand image

Credit: AP

Relatives and friends of people killed and abducted by Hamas and taken into Gaza, gather calling for their released in Tel Aviv, Israel on Saturday, Jan. 18, 2025. (AP Photo/Maya Alleruzzo)

Credit: AP

icon to expand image

Credit: AP

The Mawasi tent camp for displaced Palestinians in Khan Younis, central Gaza Strip, Saturday Jan. 18, 2025.(AP Photo/(AP Photo/Jehad Alshrafi)

Credit: AP

icon to expand image

Credit: AP

Members of the Abu Jarad family, who were displaced by the Israeli bombardment of the Gaza Strip, gather in front of their tent at a camp for displaced Palestinians in the Muwasi area, southern Gaza Strip, Saturday, Jan. 18, 2025. (AP Photo/Abdel Kareem Hana)

Credit: AP

icon to expand image

Credit: AP

Palestinians walk along a central street at dusk in Khan Younis, central Gaza Strip, Saturday Jan. 18, 2025.(AP Photo/(AP Photo/Jehad Alshrafi)

Credit: AP

icon to expand image

Credit: AP

Israeli soldiers carry combat equipment as they return from the Gaza Strip at the Israeli-Gaza border, Saturday, Jan. 18, 2025. (AP Photo/Tsafrir Abayov)

Credit: AP

icon to expand image

Credit: AP

Israeli troops are crossing into Israel from the Gaza Strip, Saturday, Jan. 18, 2025. (AP Photo/Tsafrir Abayov)

Credit: AP

icon to expand image

Credit: AP

Palestinians build a tent at the Mawasi camp in Khan Younis, central Gaza Strip, Saturday Jan. 18, 2025.(AP Photo/(AP Photo/Jehad Alshrafi)

Credit: AP

icon to expand image

Credit: AP

People hold a Palestinian flag during a demonstration for peace and in support for Palestinians, in Lisbon, Saturday, Jan. 18, 2025. (AP Photo/Armando Franca)

Credit: AP

icon to expand image

Credit: AP

A protester wearing a red glove raises her arm during a demonstration in support of Palestinians in Gaza, in Madrid, Spain, Saturday, Jan. 18, 2025. (AP Photo/Paul White)

Credit: AP

icon to expand image

Credit: AP